	.text
main:
	# FUNCTION PROLOGUE
	subu $sp, $sp, 84
	sw $s0, 8($sp)
	sw $ra, 76($sp)
	sw $fp, 80($sp)
	addu $fp, $sp, 84
	# END FUNCTION PROLOGUE

	la $s0, L1
	move $a0, $s0
	# PRE-CALL -> NO REGISTER NEEDS TO BE SAVED
	jal print
	move $s0, $v0
	li $s0, 18
	move $a0, $s0
	# PRE-CALL -> NO REGISTER NEEDS TO BE SAVED
	jal seriessum
	move $s0, $v0
	move $a0, $s0
	# PRE-CALL -> NO REGISTER NEEDS TO BE SAVED
	jal printint
	move $s0, $v0
	j L4
L4:
	# FUNCTION EPILOGUE
	lw $fp, 80($sp)
	lw $ra, 76($sp)
	lw $s0, 8($sp)
	addu $sp, $sp, 84
	jr $ra 
	# END FUNCTION EPILOGUE

seriessum:
	# FUNCTION PROLOGUE
	subu $sp, $sp, 84
	sw $s0, 8($sp)
	sw $s1, 12($sp)
	sw $ra, 76($sp)
	sw $fp, 80($sp)
	addu $fp, $sp, 84
	# END FUNCTION PROLOGUE

	move $s1, $a0
	li $s0, 0
	li $s0, 0
	add $s0, $s1, 1
	mul $s0, $s1, $s0
	div $s0, $s0, 2
	move $v0, $s0
	j L3
L3:
	# FUNCTION EPILOGUE
	lw $fp, 80($sp)
	lw $ra, 76($sp)
	lw $s0, 8($sp)
	lw $s1, 12($sp)
	addu $sp, $sp, 84
	jr $ra 
	# END FUNCTION EPILOGUE

	.data
L1: .asciiz "The algebraic sum of the series is "
